#ifndef FTPCLIENT_GLOBAL_H
#define FTPCLIENT_GLOBAL_H

#include <QtCore/qglobal.h>
#include <QDebug>

#if defined(FTP_CLIENT_CORE_LIBRARY)
#  define FTPCLIENT_EXPORT Q_DECL_EXPORT
#else
#  define FTPCLIENT_EXPORT Q_DECL_IMPORT
#endif

// 修复后的日志输出宏定义，移除不必要的转义字符
#define FTP_DEBUG_PREFIX(prefix, file, line, message) qDebug() << prefix << "[" << file << ":" << line << "]" << message
#define FTP_DEBUG(prefix, file, line, format, ...) qDebug() << prefix << "[" << file << ":" << line << "]" << QString::asprintf(format, ##__VA_ARGS__)

// 简化使用的宏，自动传入当前文件和行号
#define FTP_CLIENT_DEBUG(message) FTP_DEBUG_PREFIX(FtpClient::LOG_PREFIX, __FILE__, __LINE__, message)
#define FTP_CLIENT_DEBUG_FMT(format, ...) FTP_DEBUG(FtpClient::LOG_PREFIX, __FILE__, __LINE__, format, ##__VA_ARGS__)
#define FTP_PROTOCOL_DEBUG(message) FTP_DEBUG_PREFIX(FtpProtocol::LOG_PREFIX, __FILE__, __LINE__, message)
#define FTP_PROTOCOL_DEBUG_FMT(format, ...) FTP_DEBUG(FtpProtocol::LOG_PREFIX, __FILE__, __LINE__, format, ##__VA_ARGS__)

#endif // FTPCLIENT_GLOBAL_H